# Generate 4 unique digit number as answer
# Ask user for input 4 digit number
# Compare Answer with user's number
# Return xAxB to user
import sys
import random

def genAns(dig):
    return random.sample('0123456789', dig)

def compNumber(d1, d2, digNum):
    mA = 0
    mB = 0
    for i in range(0, digNum):
        for j in range(0, digNum):
            if i <> j :
                if int(d1[i]) == int(d2[j]): mB += 1
            else:
                if int(d1[i]) == int(d2[j]): mA += 1
    return (mA, mB)
